package com.ruoyi.jproom.mapper;

import com.ruoyi.jproom.entity.Housing;
import com.ruoyi.jproom.entity.Residential;
import com.ruoyi.jproom.entity.Sell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zeo
 * @explain 出售信息持久层
 * @date 2020/7/27 15:03
 */
public interface SellMapper {

    /**
     * 主页推荐出租、二手房房源
     *
     * @return
     */
    List<Sell> findAllRecommend(@Param("residential") Residential residential, @Param("housing") Housing housing, @Param("sell") Sell sell);

    /**
     * 新增售租关联
     * @param sell
     * @return
     */
    int addSellInfo(Sell sell);

    /**
     * 根据房源id查询售租信息
     * @param housingId
     * @return
     */
    Sell findSellInfoByHousingId(String housingId);

    /**
     * 房源售卖状态改为已出售
     * @param housingId
     * @param isDeal
     * @return
     */
    int changeIsDeal(@Param("housingId") String housingId,@Param("isDeal") int isDeal);

}
